<?php 
//print_r($_COOKIE);
if(!isset($_SESSION['user']))
{
	if(isset($_COOKIE['__bhp_user']))
	{
		$cookie	=	json_decode($_COOKIE['__bhp_user']);
		//print_r($cookie);
		if($cookie)
		{
			$_SESSION['user']	=	array('username' => $cookie->username,'email' => $cookie->email,'fullname' => $cookie->fullname);
		}
	}
}

//setcookie($name,'x',time(),'/','');
?>